package com.hsnn.medstgmini.sys.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.hsnn.medstgmini.base.dict.model.DicArea;
import com.hsnn.medstgmini.util.PinYin;

@Entity
@Table(name="reg_healthbureau")
public class RegHealthbureau implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="hea_bur_id",length=36 )
	private String heaBurId;//卫生局ID	
	
	@Column(name="hea_bur_code",length=36 )
	private String heaBurCode;//卫生局编码	
	
	@Column(name="hea_bur_name",length=512 )
	private String heaBurName;//卫生局名称	
	
	@Column(name="bur_spel_code",length=128 )
	private String burSpelCode;//卫生局名称拼音码
	
	@Column(name="org_code",length=20 )
	private String orgCode;//组织机构代码
	
	@Column(name="hosp_address",length=1024 )
	private String hospAddress;//机构地址
	
	@Column(name="hosp_phone",length=20 )
	private String hospPhone;//机构电话
	
	@Column(name="staff_num",length=11 )
	private Integer staffNum;//员工数
	
	@Column(name="profile",length=2000 )
	private String profile;//简介
	
	@Column(name="contact_name",length=20 )
	private String contactName;//联系人姓名
	
	@Column(name="contact_idnum",length=20 )
	private String contactIdnum;//联系人身份证号
	
	@Column(name="contact_pos",length=64 )
	private String contactPos;//联系人职务	
	
	@Column(name="contact_telephone",length=20 )
	private String contactTelephone;//联系人电话
	
	@Column(name="contact_handphone",length=20 )
	private String contactHandphone;//联系人手机
	
	@Column(name="contact_email",length=20 )
	private String contactEmail;//联系人邮箱	
	
	@Column(name="contact_qq",length=20 )
	private String contactQq;//联系人QQ
	
	@Column(name="reg_datetime" )
	private Date regDatetime;//注册时间
	
	@Column(name="audit_status",length=4 )
	private Integer auditStatus;//审核状态
	
	@Column(name="auditor",length=36 )
	private String auditor;//审核人
	
	@Column(name="audit_datetime")
	private Date auditDatetime;//审核时间
	
	@Column(name="audit_remark",length=1000 )
	private String auditRemark;//审核备注
	
	@OneToOne
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "area_id", referencedColumnName = "area_id")
	private DicArea area;

	@Transient
	private String auditStatusName;
	
	public String getHeaBurId() {
		return heaBurId;
	}

	public void setHeaBurId(String heaBurId) {
		this.heaBurId = heaBurId;
	}

	public String getHeaBurCode() {
		return heaBurCode;
	}

	public void setHeaBurCode(String heaBurCode) {
		this.heaBurCode = heaBurCode;
	}

	public String getHeaBurName() {
		return heaBurName;
	}

	public void setHeaBurName(String heaBurName) {
		if(heaBurName != null && !"".equals(heaBurName)){
			burSpelCode = PinYin.getPinYinHeadChar(heaBurName);
		}
		this.heaBurName = heaBurName;
	}

	public String getBurSpelCode() {
		return burSpelCode;
	}

	public void setBurSpelCode(String burSpelCode) {
		this.burSpelCode = burSpelCode;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getHospAddress() {
		return hospAddress;
	}

	public void setHospAddress(String hospAddress) {
		this.hospAddress = hospAddress;
	}

	public String getHospPhone() {
		return hospPhone;
	}

	public void setHospPhone(String hospPhone) {
		this.hospPhone = hospPhone;
	}

	public Integer getStaffNum() {
		return staffNum;
	}

	public void setStaffNum(Integer staffNum) {
		this.staffNum = staffNum;
	}

	public String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}

	public String getContactIdnum() {
		return contactIdnum;
	}

	public void setContactIdnum(String contactIdnum) {
		this.contactIdnum = contactIdnum;
	}

	public String getContactPos() {
		return contactPos;
	}

	public void setContactPos(String contactPos) {
		this.contactPos = contactPos;
	}

	public String getContactTelephone() {
		return contactTelephone;
	}

	public void setContactTelephone(String contactTelephone) {
		this.contactTelephone = contactTelephone;
	}

	public String getContactHandphone() {
		return contactHandphone;
	}

	public void setContactHandphone(String contactHandphone) {
		this.contactHandphone = contactHandphone;
	}

	public String getContactEmail() {
		return contactEmail;
	}

	public void setContactEmail(String contactEmail) {
		this.contactEmail = contactEmail;
	}

	public String getContactQq() {
		return contactQq;
	}

	public void setContactQq(String contactQq) {
		this.contactQq = contactQq;
	}

	public Date getRegDatetime() {
		return regDatetime;
	}

	public void setRegDatetime(Date regDatetime) {
		this.regDatetime = regDatetime;
	}

	public Integer getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(Integer auditStatus) {
		this.auditStatus = auditStatus;
	}

	public String getAuditor() {
		return auditor;
	}

	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}

	public Date getAuditDatetime() {
		return auditDatetime;
	}

	public void setAuditDatetime(Date auditDatetime) {
		this.auditDatetime = auditDatetime;
	}

	public String getAuditRemark() {
		return auditRemark;
	}

	public void setAuditRemark(String auditRemark) {
		this.auditRemark = auditRemark;
	}
	
	public DicArea getArea() {
		return area;
	}

	public void setArea(DicArea area) {
		this.area = area;
	}
	
	public String getAuditStatusName() {
		if (auditStatus != null) {
			auditStatusName = AuditType.getName(auditStatus);
		}
		return auditStatusName;
	}

	public void setAuditStatusName(String auditStatusName) {
		this.auditStatusName = auditStatusName;
	}

}
